        .text
        .align  1
        .globl  bubblesort
        .type   bubblesort, @function
bubblesort:
	addiw	a5,a1,-1
	ble	a5,zero,.L2
	addi	a6,a0,4
.L3:
	addiw	a1,a5,-1
	slli	a2,a1,32
	srli	a2,a2,30
	mv	a5,a0
	add	a2,a2,a6
.L5:
	lw	a3,0(a5)
	lw	a4,4(a5)
	ble	a3,a4,.L4
	sw	a3,4(a5)
	sw	a4,0(a5)
.L4:
	addi	a5,a5,4
	bne	a2,a5,.L5
	sext.w	a5,a1
	bne	a5,zero,.L3
.L2:
        li      a0,0
        ret
        .size   bubblesort, .-bubblesort
